#include <iostream>
using namespace std;
void compare (char *string1, char *string2, int size1, int size2);//compare function
void display (const char *string, int size);//output function

int main()
{
	char str1[] = {"tomato "};
	char str2[] = {"studio "};
	char str3[] = {"shu "};
	char str4[] = {"shanghai univercity "};
	compare (str1, str2, sizeof(str1)/sizeof(char), sizeof(str2)/sizeof(char));
	compare (str3, str4, sizeof(str3)/sizeof(char), sizeof(str4)/sizeof(char));
    cout << endl;
	return 0;
}

void compare (char *string1, char *string2, int size1, int size2)
{
	if (size1 < size2) 
	{
		display(string2, size2);
	}
    else if (size1 > size2)
	{
		display(string1, size1);
	}
	else if (size1 = size2)
	{
	    display(string1, size1);
		display(string2, size2);
	}
	
}

void display(const char *string, int size)
{
	for (int i=0; i<size; i++)
	{
	    cout << string[i];
	}
	cout << endl;
}
